import 'dart:convert';
/// code : 1
/// data : {"records":[{"id":"1745633823591632897","name":"老王私房菜","categoryId":"1745621681952600066","price":2000,"image":"4abe364a-61f1-4e0b-9f5f-8fffa89fd74c.png","description":"很美味","status":1,"sort":0,"createTime":"2024-01-12 10:28:31","updateTime":"2024-01-12 10:28:31","createUser":"1","updateUser":"1","isDeleted":0,"categoryName":"烧烤"}],"total":24}

DishesEntity dishesEntityFromJson(String str) => DishesEntity.fromJson(json.decode(str));
String dishesEntityToJson(DishesEntity data) => json.encode(data.toJson());
class DishesEntity {
  DishesEntity({
      num? code, 
      Data? data,}){
    _code = code;
    _data = data;
}

  DishesEntity.fromJson(dynamic json) {
    _code = json['code'];
    _data = json['data'] != null ? Data.fromJson(json['data']) : null;
  }
  num? _code;
  Data? _data;
DishesEntity copyWith({  num? code,
  Data? data,
}) => DishesEntity(  code: code ?? _code,
  data: data ?? _data,
);
  num? get code => _code;
  Data? get data => _data;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['code'] = _code;
    if (_data != null) {
      map['data'] = _data?.toJson();
    }
    return map;
  }

}

/// records : [{"id":"1745633823591632897","name":"老王私房菜","categoryId":"1745621681952600066","price":2000,"image":"4abe364a-61f1-4e0b-9f5f-8fffa89fd74c.png","description":"很美味","status":1,"sort":0,"createTime":"2024-01-12 10:28:31","updateTime":"2024-01-12 10:28:31","createUser":"1","updateUser":"1","isDeleted":0,"categoryName":"烧烤"}]
/// total : 24

Data dataFromJson(String str) => Data.fromJson(json.decode(str));
String dataToJson(Data data) => json.encode(data.toJson());
class Data {
  Data({
      List<Records>? records, 
      num? total,}){
    _records = records;
    _total = total;
}

  Data.fromJson(dynamic json) {
    if (json['records'] != null) {
      _records = [];
      json['records'].forEach((v) {
        _records?.add(Records.fromJson(v));
      });
    }
    _total = json['total'];
  }
  List<Records>? _records;
  num? _total;
Data copyWith({  List<Records>? records,
  num? total,
}) => Data(  records: records ?? _records,
  total: total ?? _total,
);
  List<Records>? get records => _records;
  num? get total => _total;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    if (_records != null) {
      map['records'] = _records?.map((v) => v.toJson()).toList();
    }
    map['total'] = _total;
    return map;
  }

}

/// id : "1745633823591632897"
/// name : "老王私房菜"
/// categoryId : "1745621681952600066"
/// price : 2000
/// image : "4abe364a-61f1-4e0b-9f5f-8fffa89fd74c.png"
/// description : "很美味"
/// status : 1
/// sort : 0
/// createTime : "2024-01-12 10:28:31"
/// updateTime : "2024-01-12 10:28:31"
/// createUser : "1"
/// updateUser : "1"
/// isDeleted : 0
/// categoryName : "烧烤"

Records recordsFromJson(String str) => Records.fromJson(json.decode(str));
String recordsToJson(Records data) => json.encode(data.toJson());
class Records {
  Records({
      String? id, 
      String? name, 
      String? categoryId, 
      num? price, 
      String? image, 
      String? description, 
      num? status, 
      num? sort, 
      String? createTime, 
      String? updateTime, 
      String? createUser, 
      String? updateUser, 
      num? isDeleted, 
      String? categoryName,}){
    _id = id;
    _name = name;
    _categoryId = categoryId;
    _price = price;
    _image = image;
    _description = description;
    _status = status;
    _sort = sort;
    _createTime = createTime;
    _updateTime = updateTime;
    _createUser = createUser;
    _updateUser = updateUser;
    _isDeleted = isDeleted;
    _categoryName = categoryName;
}

  Records.fromJson(dynamic json) {
    _id = json['id'];
    _name = json['name'];
    _categoryId = json['categoryId'];
    _price = json['price'];
    _image = json['image'];
    _description = json['description'];
    _status = json['status'];
    _sort = json['sort'];
    _createTime = json['createTime'];
    _updateTime = json['updateTime'];
    _createUser = json['createUser'];
    _updateUser = json['updateUser'];
    _isDeleted = json['isDeleted'];
    _categoryName = json['categoryName'];
  }
  String? _id;
  String? _name;
  String? _categoryId;
  num? _price;
  String? _image;
  String? _description;
  num? _status;
  num? _sort;
  String? _createTime;
  String? _updateTime;
  String? _createUser;
  String? _updateUser;
  num? _isDeleted;
  String? _categoryName;
Records copyWith({  String? id,
  String? name,
  String? categoryId,
  num? price,
  String? image,
  String? description,
  num? status,
  num? sort,
  String? createTime,
  String? updateTime,
  String? createUser,
  String? updateUser,
  num? isDeleted,
  String? categoryName,
}) => Records(  id: id ?? _id,
  name: name ?? _name,
  categoryId: categoryId ?? _categoryId,
  price: price ?? _price,
  image: image ?? _image,
  description: description ?? _description,
  status: status ?? _status,
  sort: sort ?? _sort,
  createTime: createTime ?? _createTime,
  updateTime: updateTime ?? _updateTime,
  createUser: createUser ?? _createUser,
  updateUser: updateUser ?? _updateUser,
  isDeleted: isDeleted ?? _isDeleted,
  categoryName: categoryName ?? _categoryName,
);
  String? get id => _id;
  String? get name => _name;
  String? get categoryId => _categoryId;
  num? get price => _price;
  String? get image => _image;
  String? get description => _description;
  num? get status => _status;
  num? get sort => _sort;
  String? get createTime => _createTime;
  String? get updateTime => _updateTime;
  String? get createUser => _createUser;
  String? get updateUser => _updateUser;
  num? get isDeleted => _isDeleted;
  String? get categoryName => _categoryName;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['name'] = _name;
    map['categoryId'] = _categoryId;
    map['price'] = _price;
    map['image'] = _image;
    map['description'] = _description;
    map['status'] = _status;
    map['sort'] = _sort;
    map['createTime'] = _createTime;
    map['updateTime'] = _updateTime;
    map['createUser'] = _createUser;
    map['updateUser'] = _updateUser;
    map['isDeleted'] = _isDeleted;
    map['categoryName'] = _categoryName;
    return map;
  }

}